package com.jcgyl.export.model;

public enum UnitCategory {
	/// <summary>
	/// 长度
	/// </summary>
	Length(1),
	/// <summary>
	/// 面积
	/// </summary>
	Area(2),
	/// <summary>
	/// 重量
	/// </summary>
	Weight(3),
	/// <summary>
	/// 数量
	/// </summary>
	Count(4),
	/// <summary>
	/// 体积
	/// </summary>
	Volume(5);

	private final int value;

	// 构造方法必须是private或者默认
	private UnitCategory(int value) {
		this.value = value;
	}

	public UnitCategory valueOf(int value) {
		switch (value) {
		case 1:
			return UnitCategory.Length;
		case 2:
			return UnitCategory.Area;
		case 3:
			return UnitCategory.Weight;
		case 4:
			return UnitCategory.Count;
		case 5:
			return UnitCategory.Volume;
		default:
			return null;
		}
	}
}
